<?php

namespace DC\UserCenter\Models;

use App\Models\BaseModel;

class UserInfoModel extends BaseModel
{
    protected $table = 'users_info';

    protected $primaryKey = 'member_id';

    public $dateFormat = 'U';

    protected $guarded = [];

    public function handleData($data)
    {
        $info['user_sex'] = $data['user_sex']??1;
        $info['ID_card'] = $data['ID_card']??'';
        $info['ID_card_front'] = $data['ID_card_front']??'';
        $info['ID_card_back'] = $data['ID_card_back']??'';
        $info['user_number'] = $data['user_number'];
        $info['alipay'] = $data['alipay']??'';
        $info['weichat'] = $data['weichat']??'';
        $info['receiving_code'] = $data['receiving_code']??'';
        $info['bank_card'] = $data['bank_card']??'';
        $info['bank_name'] = $data['bank_name']??'';
        $info['bank_mobile'] = $data['bank_mobile']??'';
        $info['bank_holder'] = $data['real_name']??'';
        $info['live_area'] = arr2str($data['live_area']?? '');
        $info['live_address'] = $data['live_address']??'';
        return $info;
    }
}
